<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.1</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
      <!--百度ueditor-->
    <script src="__ADMIN__/plus/ueditor/ueditor.config.js"></script>
    <script src="__ADMIN__/plus/ueditor/ueditor.all.min.js"></script>

    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
      .layui-form-item .layui-form-checkbox[lay-skin=primary]{
          margin-top: 0;
      }
    </style>
  </head>
  
  <body>
    <div class="x-body x-admin">
        <form class="layui-form">

          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                活动名称:
              </label>
              <div class="layui-input-block" style="padding: 9px 15px;">
                {$articles.title}
              </div>
          </div>

          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  奖惩说明:
              </label>
              <div class="layui-input-block" style="padding: 9px 15px;">
                  {$articles.desc}
              </div>
          </div>
          
            <div class="layui-form-item">
              <label for="start_time" class="layui-form-label">
                  活动时间:
              </label>
              <div class="layui-input-block" style="padding: 9px 15px;">
                  {$articles.start_time|date="Y-m-d H:i:s",###}~{$articles.end_time|date="Y-m-d H:i:s",###}
              </div>
            </div>
            
            <div class="layui-form-item">
              <label for="start_time" class="layui-form-label">
                  录入客户:
              </label>
              <div class="layui-input-block" style="padding: 9px 15px;">
                  {$articles.luru_fen}分
              </div>
            </div>
            <div class="layui-form-item">
              <label for="start_time" class="layui-form-label">
                  签单客户:
              </label>
              <div class="layui-input-block" style="padding: 9px 15px;">
                  {$articles.qiandan_fen}分
              </div>
            </div>
            
            <div class="layui-table-body layui-table-main" style="width: 100%;">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <th>排名</th>
                    <th>pk组</th>
                    <th>总录入</th>
                    <th>总签单</th>
                    <th>总分数</th>
                  </tr>
                </thead>
                <tbody>
                  {volist name="cats_Arr" id="cat"}
                  <tr>
                    <td>{$key + 1}</td>
                    <td>{$cat.cat_name}&nbsp;&nbsp;&nbsp;组内成员：({$cat.admins_name ? $cat.admins_name : '暂无'})</td>
                    <td>{$cat.count}</td>
                    <td>{$cat.qiandan}</td>
                    <td>{$cat.count_fen}</td>
                  </tr>
                  {/volist}
                </tbody>
              </table>
            </div>
      </form>
    </div>
    <script>

        layui.use(['form','layer','laydate'], function(){
          $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer
          ,laydate = layui.laydate;
          
          
          laydate.render({
            elem: '#start_time' //指定元素
            ,type: 'datetime'
          });
          laydate.render({
            elem: '#end_time' //指定元素
            ,type: 'datetime'
          });
          //监听提交
          form.on('submit(add)', function(data){
            var cats = tableCheck.getData();
            $.ajax({
                type:'POST',
                dataType:'json',
                data:{data:data.field,cats:cats},
                url:"{:url('Pk/add')}",
                success:function(obj){
                  layer.alert(obj.msg, {icon: obj.icon},function(){
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                    // 可以对父窗口进行刷新 
                    x_admin_father_reload();
                  });
                }
            });
            return false;
          });
          
        });
    </script>
  </body>

</html>